﻿using System;
using GDIT.BLL;
using GDIT.Model;
using GDIT.Base.PageBaseHelper;

namespace GDIT.page.manage.InnerNet
{
    public partial class inner : System.Web.UI.Page
    {

        private BInternalIP internalIP = null;


        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Session["UserName"].ToString()))
            {
                PageBase.MessageBoxShowAndGo("检查到你还没有登录，请先登录，谢谢！", "~/page/manage/login.aspx", Page);
                return;
            }
            if (!IsPostBack)
            {
                BindInternalIP();
            }
        }
        //绑定所有的内部IP范围字段
        private void BindInternalIP()
        {
            internalIP = new BInternalIP();
            this.rptIp.DataSource = internalIP.SelectAllInternalIP();
            this.rptIp.DataBind();
        }

        /// <summary>
        /// 删除ip范围
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_OnClick(object sender, EventArgs e)
        {
            string a = txtLeft.Text;//起始ip
            string b = txtRight.Text;//结束ip\
            internalIP = new BInternalIP();
        }

        /// <summary>
        /// 添加ip范围
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            string a = txtLeft.Text;//起始ip
            string b = txtRight.Text;//结束ip\
            internalIP = new BInternalIP();
        }

        /// <summary>
        /// 修改保存ip范围
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_OnClick(object sender, EventArgs e)
        { 
            
        }

    }
}